<template>
    <div style="display: flex; justify-content: space-between; align-items: center; padding: 10px 20px; background-color: #f5f5f5;">
        <div>
            <span>首页</span>
        </div>
        <div>
            <el-button @click="logout">退出登陆</el-button>
        </div>
    </div>
</template>

<script setup>
import api from '@/api'
import { useRouter } from 'vue-router'
const router = useRouter()

const logout = () => {
    api.logout()
    router.push('/login')
}
</script>